package com.jilefojing.service;

import java.util.List;

import com.jilefojing.beans.enums.ThirdPartyTypeEnum;
import com.jilefojing.beans.enums.foruser.StatusEnumForUser;
import com.jilefojing.beans.exception.UserContextException;
import com.jilefojing.beans.pojos.User;
import com.jilefojing.beans.pojos.enhanced.EnhancedUser;
import com.jilefojing.beans.vo.Pagination;
import com.jilefojing.context.beans.vo.UserContext;
import com.jilefojing.service.base.IBaseService;

/**
 * 
 * @author jgshun
 * 
 */
public interface IUserService extends IBaseService<User> {
	/**
	 * 查询分页数据
	 * 
	 * @param statuses
	 *            为空查询全部
	 * @param pagination
	 * @return
	 */
	Pagination<EnhancedUser> getPagination(List<StatusEnumForUser> statuses, Pagination<EnhancedUser> pagination);

	/**
	 * 获取用户详情
	 * 
	 * @param id
	 * @return
	 */
	EnhancedUser getEnhancedUser(long id);

	/**
	 * 获取用户详情列表
	 * 
	 * @param ids
	 * @return
	 */
	List<EnhancedUser> getEnhancedUsers(List<Long> ids);

	/**
	 * 通过账户获取用户信息
	 * 
	 * @param account
	 *            账户:邮箱 手机号
	 * @return
	 */
	User getUserByAccount(String account) throws UserContextException;

	/**
	 * 通过账户获取用户信息
	 * 
	 * @param account
	 *            账户:邮箱 手机号
	 * @return
	 */
	EnhancedUser getEnhancedUserByAccount(String account) throws UserContextException;

	/**
	 * 把userInfo对象装换成加强对象 -->包括把用户相关的图片地址封装成全地址
	 * 
	 * @param users
	 * @return
	 */
	List<EnhancedUser> conventUsersToEnhancedUsers(List<User> users);

	EnhancedUser getEnhancedUserByThirdParty(String thirdPartyId, ThirdPartyTypeEnum thirdPartyType, UserContext userContext) throws UserContextException;

	User add(User user, UserContext userContext) throws UserContextException;

}
